package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.UserAccountMapper;
import com.education.wisdom.pojo.UserAccount;
import com.education.wisdom.service.IUserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户账户 服务层实现
 * 
 * @author ruoyi
 * @date 2018-11-20
 */
@Service
public class UserAccountServiceImpl implements IUserAccountService
{
	@Autowired
	private UserAccountMapper userAccountMapper;

	/**
     * 查询客户账户信息
     * 
     * @param id 客户账户ID
     * @return 客户账户信息
     */
    @Override
	public UserAccount selectUserAccountById(Integer id)
	{
	    return userAccountMapper.selectUserAccountById(id);
	}
	
	/**
     * 查询客户账户列表
     * 
     * @param userAccount 客户账户信息
     * @return 客户账户集合
     */
	@Override
	public List<UserAccount> selectUserAccountList(UserAccount userAccount)
	{
	    return userAccountMapper.selectUserAccountList(userAccount);
	}
	
    /**
     * 新增客户账户
     * 
     * @param userAccount 客户账户信息
     * @return 结果
     */
	@Override
	public int insertUserAccount(UserAccount userAccount)
	{
	    return userAccountMapper.insertUserAccount(userAccount);
	}
	
	/**
     * 修改客户账户
     * 
     * @param userAccount 客户账户信息
     * @return 结果
     */
	@Override
	public int updateUserAccount(UserAccount userAccount)
	{
	    return userAccountMapper.updateUserAccount(userAccount);
	}

	/**
     * 删除客户账户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteUserAccountByIds(String ids)
	{
		return userAccountMapper.deleteUserAccountByIds(Convert.toStrArray(ids));
	}

	@Override
	public UserAccount selectUserAccountByUserId(String userId) {
		return userAccountMapper.selectUserAccountByUserId(userId);
	}

	@Override
	public UserAccount selectUserCurrency(String userId) {
		return userAccountMapper.selectUserCurrency(userId);
	}

}
